/*
 * 易族智汇（北京）科技有限公司 版权所有。
 * 未经许可，您不得使用此文件。
 * 官方地址：www.javamall.com.cn
 */
package com.enation.app.javashop.core.client.feignimpl.trade;


import com.enation.app.javashop.client.trade.PintuanClient;
import com.enation.app.javashop.core.client.fallback.trade.PintuanClientFallbackFactory;
import com.enation.app.javashop.core.handler.FeignConfiguration;
import com.enation.app.javashop.model.promotion.pintuan.Pintuan;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 拼团client
 *
 * @author liushuai
 * @version v1.0
 * @Description:
 * @since v7.0
 * 2019/2/18 上午11:39
 */
@FeignClient(name = "trade-service", fallbackFactory = PintuanClientFallbackFactory.class,configuration = {FeignConfiguration.class})
public interface PintuanClientFeignImpl extends PintuanClient {


    /**
     * 获取拼团
     *
     * @param id 拼团主键
     * @return Pintuan  拼团
     */
    @Override
    @RequestMapping(value = "/client/pintuan/{id}",method = RequestMethod.GET)
    Pintuan getModel(@PathVariable("id") Long id);

    /**
     * 根据状态查询拼团活动
     *
     * @param status 状态
     * @return 拼团活动集合
     */
    @Override
    @RequestMapping(value = "/client/pintuan/status/{status}",method = RequestMethod.GET)
    List<Pintuan> get(@PathVariable("status") String status);

    /**
     * 停止一个活动
     *
     * @param promotionId
     */
    @Override
    @PostMapping("/client/pintuan/promotion/{promotion_id}/close")
    void closePromotion(@PathVariable("promotion_id") Long promotionId);

    /**
     * 开始一个活动
     *
     * @param promotionId
     */
    @Override
    @PostMapping("/client/pintuan/promotion/{promotion_id}/open")
    void openPromotion(@PathVariable("promotion_id")Long promotionId);
}
